# debugging       -*- Makefile -*-
OCAMLC = ocamlcp -g
OCAMLCI = ocamlc -g
OCAMLLINK = ocamlcp -custom -g
O= cmo
A= cma

# non debugging
OCAMLC = ocamlopt
OCAMLCI = ocamlopt
OCAMLLINK = ocamlopt
O= cmx
A= cmxa

all: genfft

.SUFFIXES: .$(O) .cmi .ml .mli

# order is important here
OBJS =  \
	magic.$(O) \
	util.$(O) \
	number.$(O) \
	variable.$(O) \
	expr.$(O) \
	dag.$(O) \
	exprdag.$(O) \
	complex.$(O) \
	schedule.$(O) \
	asched.$(O) \
	twiddle.$(O) \
	symmetry.$(O) \
	fft.$(O) \
	to_c.$(O) \
	genfft.$(O)

genfft: $(OBJS)
	rm -f genfft
	$(OCAMLLINK) nums.$(A) unix.$(A) -o genfft $(OBJS) -cclib -lnums \
	   -cclib -lunix

%.$(O):	%.ml
	$(OCAMLC) -c $<

%.cmi:	%.mli
	$(OCAMLCI) -c $<

# dependency list generated by ocamldep
asched.cmo: expr.cmi magic.cmo schedule.cmi util.cmi variable.cmi asched.cmi 
asched.cmx: expr.cmx magic.cmx schedule.cmx util.cmx variable.cmx asched.cmi 
ast.cmo: asched.cmi 
ast.cmx: asched.cmx 
complex.cmo: exprdag.cmi number.cmi variable.cmi complex.cmi 
complex.cmx: exprdag.cmx number.cmx variable.cmx complex.cmi 
dag.cmo: expr.cmi util.cmi variable.cmi dag.cmi 
dag.cmx: expr.cmx util.cmx variable.cmx dag.cmi 
expr.cmo: number.cmi variable.cmi expr.cmi 
expr.cmx: number.cmx variable.cmx expr.cmi 
exprdag.cmo: expr.cmi magic.cmo number.cmi util.cmi variable.cmi exprdag.cmi 
exprdag.cmx: expr.cmx magic.cmx number.cmx util.cmx variable.cmx exprdag.cmi 
fft.cmo: complex.cmi exprdag.cmi magic.cmo symmetry.cmo twiddle.cmo util.cmi 
fft.cmx: complex.cmx exprdag.cmx magic.cmx symmetry.cmx twiddle.cmx util.cmx 
genfft.cmo: asched.cmi expr.cmi exprdag.cmi fft.cmo magic.cmo schedule.cmi \
    symmetry.cmo to_c.cmi twiddle.cmo util.cmi variable.cmi 
genfft.cmx: asched.cmx expr.cmx exprdag.cmx fft.cmx magic.cmx schedule.cmx \
    symmetry.cmx to_c.cmx twiddle.cmx util.cmx variable.cmx 
number.cmo: util.cmi number.cmi 
number.cmx: util.cmx number.cmi 
schedule.cmo: dag.cmi expr.cmi magic.cmo util.cmi variable.cmi schedule.cmi 
schedule.cmx: dag.cmx expr.cmx magic.cmx util.cmx variable.cmx schedule.cmi 
symmetry.cmo: complex.cmi exprdag.cmi util.cmi 
symmetry.cmx: complex.cmx exprdag.cmx util.cmx 
to_c.cmo: asched.cmi expr.cmi exprdag.cmi fft.cmo magic.cmo number.cmi \
    util.cmi variable.cmi to_c.cmi 
to_c.cmx: asched.cmx expr.cmx exprdag.cmx fft.cmx magic.cmx number.cmx \
    util.cmx variable.cmx to_c.cmi 
twiddle.cmo: complex.cmi magic.cmo util.cmi 
twiddle.cmx: complex.cmx magic.cmx util.cmx 
util.cmo: magic.cmo util.cmi 
util.cmx: magic.cmx util.cmi 
variable.cmo: variable.cmi 
variable.cmx: variable.cmi 
asched.cmi: expr.cmi schedule.cmi variable.cmi 
complex.cmi: exprdag.cmi 
dag.cmi: expr.cmi util.cmi variable.cmi 
expr.cmi: number.cmi variable.cmi 
exprdag.cmi: expr.cmi number.cmi variable.cmi 
schedule.cmi: expr.cmi 
to_c.cmi: asched.cmi expr.cmi variable.cmi 
